<template>
  <div class="keepListBox">
    <header-box title="常购清单" :showLeft="true" :showRight="false"></header-box>
    <!-- 降价区 -->
    <div v-if="brandList.length!==0" class="goodsList">
      <div class="recomend flex_center">
        <img src="../assets/images/guessTitle-icon.png" alt class="leftImg" />
        <span>降价区</span>
        <img src="../assets/images/guessTitle-icon2.png" alt class="rightImg" />
      </div>
      <div class="listBox clearfix">
        <div v-for="(item,index) in downList" :key="index" class="listItem">
          <div class="imgBox">
            <img :src="item.img" alt class="goodsImg" />
            <div v-if="item.downMoney" class="downHint">比上次降{{item.downMoney}}元</div>
          </div>
          <div class="infoBox">
            <div class="money">¥{{item.money}}</div>
            <div class="footer">
              <div class="num">已购买{{item.buyNum}}次</div>
              <img src="../assets/images/cartadd01.jpeg" alt class="cartImg" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 品牌购 -->
    <div v-if="downList.length!==0" class="goodsList">
      <div class="recomend flex_center">
        <img src="../assets/images/guessTitle-icon.png" alt class="leftImg" />
        <span>品牌购</span>
        <img src="../assets/images/guessTitle-icon2.png" alt class="rightImg" />
      </div>
      <div class="listBox clearfix">
        <div v-for="(item,index) in brandList" :key="index" class="listItem">
          <div class="imgBox">
            <img :src="item.img" alt class="goodsImg" />
            <div v-if="item.downMoney" class="downHint">比上次降{{item.downMoney}}元</div>
          </div>
          <div class="infoBox">
            <div class="money">¥{{item.money}}</div>
            <div class="footer">
              <div class="num">已购买{{item.buyNum}}次</div>
              <img src="../assets/images/cartadd01.jpeg" alt class="cartImg" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 可能再买 -->
    <div v-if="guessList.length!==0" class="goodsList">
      <div class="recomend flex_center">
        <img src="../assets/images/guessTitle-icon.png" alt class="leftImg" />
        <span>可能再买</span>
        <img src="../assets/images/guessTitle-icon2.png" alt class="rightImg" />
      </div>
      <div class="listBox clearfix">
        <div v-for="(item,index) in guessList" :key="index" class="listItem">
          <div class="imgBox">
            <img :src="item.img" alt class="goodsImg" />
          </div>
          <div class="infoBox">
            <div class="money">¥{{item.money}}</div>
            <div class="footer">
              <div class="num">已购买{{item.buyNum}}次</div>
              <img src="../assets/images/cartadd01.jpeg" alt class="cartImg" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderBox from '@/components/header'

export default {
  components: {
    HeaderBox
  },
  data() {
    return {
      downList: [
        {
          img: require('../assets/images/1572917425316_imgApp_tmndir.jpg'),
          downMoney: '6.90',
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1572917425316_imgApp_tmndir.jpg'),
          downMoney: '6.90',
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1572917425316_imgApp_tmndir.jpg'),
          downMoney: '6.90',
          money: '29.90',
          buyNum: '1'
        }
      ],
      brandList: [
        {
          img: require('../assets/images/1574040779889_app_wap_list.jpg'),
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1574040779889_app_wap_list.jpg'),
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1574040779889_app_wap_list.jpg'),
          money: '29.90',
          buyNum: '1'
        }
      ],
      guessList: [
        {
          img: require('../assets/images/1493018450115_pc_list.jpg'),
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1493018450115_pc_list.jpg'),
          money: '29.90',
          buyNum: '1'
        },
        {
          img: require('../assets/images/1493018450115_pc_list.jpg'),
          money: '29.90',
          buyNum: '1'
        }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.keepListBox {
  .goodsList {
    margin-bottom: 20px;
    .recomend {
      text-align: center;
      margin-top: 30px;
      img {
        width: 50px;
        height: 12px;
        padding-bottom: 6px;
      }
      .rightImg {
        transform: rotateY(180deg);
      }
      span {
        font-weight: bold;
        font-size: 30px;
        margin: 0 10px;
      }
    }
    .listBox {
      margin: 20px;
      .listItem {
        background-color: #fff;
        border-radius: 20px;
        margin-right: 20px;
        float: left;
        overflow: hidden;
        width: 31.2%;
        &:nth-child(3n) {
          margin-right: 0;
        }
        .imgBox {
          position: relative;
          width: 100%;
          height: 220px;
          .goodsImg {
            width: 100%;
            height: 100%;
          }
          .downHint {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: 40px;
            line-height: 40px;
            background-color: #f4b345;
            color: #fff;
            text-align: center;
          }
        }
        .infoBox {
          padding: 10px;
          .money {
            color: #ee6f2e;
            font-size: 30px;
          }
          .footer {
            display: flex;
            align-items: center;
            .num {
              color: #666;
            }
            .cartImg {
              margin-left: auto;
              width: 40px;
            }
          }
        }
      }
    }
  }
}
</style>